package com.cn.proxy.dynamicproxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class MyHandler implements InvocationHandler {
	private Object subject;

	public MyHandler(Object subject) {
		this.setSubject(subject);
	}

	public Object getSubject() {
		return subject;
	}

	public void setSubject(Object subject) {
		this.subject = subject;
	}

	@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		System.out.println("log,info,debug,warn.....................");
		Object result = method.invoke(subject, args);
		System.out.println("----------------------------------------");
		return result;
	}

}
